|
|
@@ -14,7 +14,8 @@ describe Agents::TwitterUserAgent do
|
14
|
14
|
:consumer_key => "---",
|
15
|
15
|
:consumer_secret => "---",
|
16
|
16
|
:oauth_token => "---",
|
17
|
|
- :oauth_token_secret => "---"
|
|
17
|
+ :oauth_token_secret => "---",
|
|
18
|
+ :choose_home_time_line => 'false'
|
18
|
19
|
}
|
19
|
20
|
|
20
|
21
|
@checker = Agents::TwitterUserAgent.new(:name => "tectonic", :options => @opts)
|
|
|
@@ -42,4 +43,21 @@ describe Agents::TwitterUserAgent do
|
42
|
43
|
end
|
43
|
44
|
end
|
44
|
45
|
|
|
46
|
+ describe "#check that home timeline works" do
|
|
47
|
+ before do
|
|
48
|
+ stub_request(:any, //).to_return(:body => File.read(Rails.root.join("spec/data_fixtures/user_tweets.json")), :status => 200)
|
|
49
|
+ end
|
|
50
|
+
|
|
51
|
+ it "should check that event changed with timeline sets to true" do
|
|
52
|
+
|
|
53
|
+ opts = @opts.tap { |ots| ots.delete(:username)}.merge({ :choose_home_time_line => "true" })
|
|
54
|
+
|
|
55
|
+ checker = Agents::TwitterUserAgent.new(:name => "tectonic", :options => opts)
|
|
56
|
+ checker.service = services(:generic)
|
|
57
|
+ checker.user = users(:bob)
|
|
58
|
+ checker.save!
|
|
59
|
+
|
|
60
|
+ expect { checker.check }.to change { Event.count }.by(5)
|
|
61
|
+ end
|
|
62
|
+ end
|
45
|
63
|
end
|